<?php
class frontController
{
	protected $controller;
	public function load() 
	{
		global $module, $error, $database;
		if($module == '' ||$module == "" )
			$module = 'poi';
		if(file_exists('controller/'.$module.'.inc.php'))
		{
			require_once('controller/'.$module.'.inc.php');
			$this->controller = new $module();
            //var_dump($this->controller);die;
			//$this->controller->indexAction($database);
            //$this->controller->show();
        }
		else
		{
			echo $error[5];
		}
	}
   
	public function show()
	{
		global $database;
		$this->controller->indexAction($database);
	}
	
	public function title()
	{
		echo 'Baza danych - POI::'.$this->controller->title();
	}
}
?>